<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增报页')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-reporttab-add">
			<div class="form-group">
				<label class="col-sm-3 control-label">所属报表：</label>
				<div class="col-sm-8">

					<select name="reportid" id="reportid" class="form-control">
						<option value="">--请选择--</option>
						<option th:each="item:${report}" th:value="${item.id}"
							th:text="${item.title}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">标题：</label>
				<div class="col-sm-8">
					<input name="title" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">SQL：</label>
				<div class="col-sm-8">
					<textarea name="sql" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">列表SQL：</label>
				<div class="col-sm-8">
					<textarea name="listsql" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">数据接口地址 ：</label>
				<div class="col-sm-8">
					<textarea name="apiurl" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">接口参数：</label>
				<div class="col-sm-8">
					<textarea name="apiparam" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">接口标签：</label>
				<div class="col-sm-8">
					<textarea name="apitag" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">页签排序：</label>
				<div class="col-sm-8">
					<input name="sortnum" class="form-control" type="number" required
						maxlength="10" onkeyup="value=value.replace(/[^\d]/g,'')"
						onblur="value=value.replace(/[^\d]/g,'')" placeholder="请输入数字">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">数据源：</label>
				<div class="col-sm-8">
					<select name="sourceid" id="sourceid" class="form-control">
						<option value="">--请选择--</option>
						<option th:each="item:${datasource}" th:value="${item.id}"
							th:text="${item.title}"></option>
					</select>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
		var prefix = ctx + "web/reporttab"
		$("#form-reporttab-add").validate({
			focusCleanup : true
		});

		function submitHandler() {
			if ($.validate.form()) {
				$.operate.save(prefix + "/add", $('#form-reporttab-add')
						.serialize());
			}
		}
	</script>
</body>
</html>